﻿$(function () {
        //选择客户
        $(".select-custom").live("click", function () {
            $.dialog({
                id: "selectCustomer",
                title: "选择客户",
                lock: true,
                content: $("#selectCustom").html()
            });
        });
      
   
        //全部保存
        $("#btnSaveAll").bind("click", function () {
            var items = [];
            $("#reserveList").find("input[name=reserveinfo]").each(function () {
                var item = {};
                item.InquiryKeyId = $(this).attr("customerkeyid");
                item.SeePropertyType = $(this).attr("seetype");
                item.ReserveTime = $(this).attr("time");
                item.Content = $(this).attr("value");;
                item.InquiryFollowType = 1;
                item.PropertyKeyId = $(this).attr("pkeyid");
                items.push(item);
            });
            $.ajax({
                url: "inquiry-follow-add-ajax",
                type: "POST",
                data: JSON.stringify(items),

                success: function (data) {
                    if (data != "ok") {
                        $.OKDialogAgency('<div class="tc">' + data + '</div>');
                    }
                    else {
                        window.location = "/customer/inquiry-taking";
                    }
                },
                error: function (e) {
                    $.OKDialogAgency('<div class="tc">' + e + '</div>');
                }
            });
        });
        //批量录入约看 录入约看
        $(".input-invite").bind("click", function () {
            $.dialog({
                id: "inputGuide",
                title: "录入约看",
                lock: true,
                width: 724,
                content: $("#inputInvite").html()
            });
            agencyVerify.nonnegativeInput("input[num]");
            //选择房源
            takeSee.selectPerportDiv(".select-source", false, null);
        });
    });
